package com.tul.exercise.base.jmockit.mockpublicmethod.conponent;

import com.tul.exercise.base.jmockit.mockpublicmethod.itf.Demo1DAO;
import com.tul.exercise.base.jmockit.mockpublicmethod.itf.Demo1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 《JMockit中文版入门指南》 1.4 Mock 普通公有方法
 * 接口实现类
 *
 * @author tuliang
 */
//@Component
public class Demo1ServiceImpl implements Demo1Service {

    @Autowired
    private Demo1DAO demo1DAO;

    @Override
    public String sayName() {
        return demo1DAO.getName();
    }

    @Override
    public int sayAge() {
        return demo1DAO.getAge();
    }

    @Override
    public boolean isTp() {
        return demo1DAO.isTp();
    }

    public void setDemo1DAO(Demo1DAO demo1DAO) {
        this.demo1DAO = demo1DAO;
    }
}
